﻿namespace Komunikator
{
    using System.Windows.Data;
    using Komunikator;

    public class SexConverter : IValueConverter
    {
        public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string charSex = (string)value;
            switch (charSex)
            {
                case "M":
                    return "Mężczyzna";
                case "F":
                    return "Kobieta";
                default:
                    return null;
            }
        }

        public object ConvertBack(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string stringSex = (string)value;
            switch (stringSex)
            {
                case "Mężczyzna":
                    return "M";
                case "Kobieta":
                    return "F";
                default:
                    return null;
            }
        }
    }
}